package com.bishe.demo.modules.common.dao;

import com.bishe.demo.modules.common.entity.City;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface CityDao {
    @Select("select * from common_city where pid=#{id}")
    List<City> getCitiesByPid(int id);

    @Select("select * from common_city as cc left join tourism_route_city as trc on cc.id = trc.city_id " +
            "where trc.route_id = #{routeId}")
    List<City> getCitiesByRouteId(Integer routeId);

    @Select("select * from common_city as cc left join ticket_site_table as tst on tst.fk_city_id = cc.id " +
    "where tst.fk_city_id = #{fkCityId} ")
    City getCitiesByFkCityId(Integer fkCityId);




}
